﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using QMERP.Domain.Entities;

namespace QMERP.Infrastructure.EFCore.Mappings
{
    public class BulkOrderDetail_LensDetailMapping : IEntityTypeConfiguration<BulkOrderDetail_LensDetail>
    {
        public void Configure(EntityTypeBuilder<BulkOrderDetail_LensDetail> builder)
        {
            builder.Property(x => x.DegreesType).HasMaxLength(5);
            builder.Property(x => x.SPH);
            builder.Property(x => x.CYL);
            builder.Property(x => x.ADD);
            builder.Property(x => x.Qty);
            builder.Property(x => x.LeaveStockQty);
            builder.Property(x => x.TaxPrice).HasPrecision(18, 2);
            builder.Property(x => x.NoTaxPrice).HasPrecision(18, 2);
            builder.Property(x => x.Price).HasPrecision(18, 2);
            builder.Property(x => x.Discount);

            builder.Property(x => x.BulkOrderDetailId);

            builder.HasIndex(x => x.Id);
            builder.HasIndex(x => x.DegreesType);
            builder.HasIndex(x => x.BulkOrderDetailId);
        }
    }
}
